package com.bnz.page.controller;

import com.bnz.common.entity.R;
import com.bnz.page.service.PageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseBody;

import java.io.IOException;

@Controller
public class PageController {
    @Autowired
    private PageService pageService;
    // 生成静态化页面
    @GetMapping("/page/createPage/{id}")
    // 将Java对象转换成json格式的数据
    @ResponseBody
    public R page(@PathVariable Long id) throws IOException {
        pageService.createPage(id);
        return R.ok();
    }
}
